<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
	<style type="text/css">
	body{height: 1000px;background-color: #676767; margin: 0}
	div{width: 0; height: 0;}
	a{width: 100px; height: 100px; background-color: red;position: absolute;right:0; top: 900px;}
	</style>
	<script type="text/javascript">
	window.onload = function  () {
		var oDiv = document.getElementById('top')
		var oA = document.getElementsByTagName('a')[0];

		oA.onclick = function  () {

			// 方法一:【推荐】
			 this.href = 'javascript:scroll( 0, 0 )';

			// 方法二：(差：重新加载了网址)
			// open( window.location, '_self');

			// 方法三：
			// open( '#', '_self');

			// 方法四：设置锚点
			/*this.href = '#top';
			this.target = '_self';*/
		}
	
	
	}
	</script>
</head>
<body>
	<div id="top"></div>
	<a></a>
</body>
</html>